package cn.school.thoughtworks.section1;

import java.util.ArrayList;
import java.util.List;

public class PracticeA {
    List<String> collectSameElements(List<String> collection1, List<String> collection2) {
        List<String> collection3 = new ArrayList<>();
        for(String m:collection1)
        {
            for (String n:collection2)
            {
                if (m==n)
                {
                    collection3.add(m);
                }
            }
        }



        //实现练习要求，并改写该行代码。
        return collection3;
    }
}
